/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * www.sofut.com mysite
 * www.aixq.com blog
 */
function ajaxsend(actset,inputid,showmsg)
{
    $.ajax({
        beforeSend:function(){
            $("#msg").html("正在建立链接..");
        },
        dataType:"json",
        type: "post",
        url:"ajax.php?act="+actset,
        data: $("#"+inputid+" :input").serialize(),
        success: function(json){
           
            if(json.msg)
            {
                if(showmsg)
                {
                    alert(json.msg);
                }
                $("input[type=reset]").click();
                $("#msg").html(json.msg);
                if($("#loadbody").text()!="")
                {
                    $("#loadbody").load(window.location.href+"?"+Math.random()+" #loadbody",function(){});
                }
            }
            else
            {
                alert(json.error);
                $("#msg").html(json.error);
                   

            }
          
        },
        error:function(){
            $("#msg").html("链接出错");
        }
    });
}